package com.jt.common.net;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

public class Browser {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",9999);
        InputStream in = socket.getInputStream();
        byte[] buf = new byte[1024];
        int len=in.read(buf);
        String content=new String(buf,0,len);
        System.out.println(content);
        //3.释放资源
        socket.close();
    }
}
